package com.example.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.shop.bean.ShoppingBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface ShoppingMapper extends BaseMapper<ShoppingBean> {

    @Select("select * from tbl_shopping where oid=#{oid}")
    List<ShoppingBean> shoppingSelByOid(@Param("oid") int oid);

    @Select("insert into tbl_shopping(count,pid,oid) values(#{count},#{pid},#{oid})")
    void shoppingInsert(@Param("count")int count,@Param("pid")int pid,@Param("oid")int oid);

    @Select("delete from tbl_shopping where oid=#{oid}")
    void shoppingDel(@Param("oid")int oid);
}
